GBML manual / Rooms

room_bottom

The y coordinate of the current room’s bottom edge - the line where the room ends, one past the last pixel inside it.

Syntax

room_bottom() -> int

Returns

int

Description

Gives back the y position of the bottom edge of the room you are in. It is the up-and-down partner of room_right, and everything on the room_left page about the origin applies here too.

Because y counts down, the bottom edge is the bigger number. Like room_right, it is the line where the room stops, one past the last pixel inside it, and it is always exactly room_top() + room_height(). Counted from the room's top-left corner, it is the same number as room_height().

Example

if (y > room_bottom()) {
    y = room_top();
}

When this instance has gone past the bottom edge of the room, puts it back at the top edge, so it wraps around from the bottom to the top.

On the GBA

Worked out as the top edge plus the height, so it can never disagree with room_top or room_height.

See also: room_toproom_leftroom_rightroom_height